﻿namespace AbpPlusPlus.RabbitMq
{
    using Abp;
    using Abp.Events.Bus;
    using Abp.Modules;
    using Abp.Reflection.Extensions;

    using AbpPlusPlus.RabbitMq.Configuration;

    [DependsOn(typeof(AbpKernelModule))]
    public class AbpRabbitMqModule : AbpModule
    {
        public override void PreInitialize()
        {
            this.IocManager.Register<IAbpRabbitMqModuleConfiguration, AbpRabbitMqModuleConfiguration>();

            this.IocManager.Register<IRabbitMqProvider, RabbitMqProvider>();
            this.IocManager.Register<IEventBus,RabbitMqEventBus>();
        }

        public override void Initialize()
        {
            this.IocManager.RegisterAssemblyByConvention(
                typeof(AbpRabbitMqModule).GetAssembly());
        }
    }
}